package com.polimi.meteocal.business.entity;

import java.io.Serializable;

import javax.persistence.*;


/**
 * The persistent class for the weather database table.
 * 
 */
@Entity
@NamedQuery(name="Weather.findAll", query="SELECT w FROM Weather w")
public class Weather implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="EVENT_ID")
	private int eventId;

	@Column(name="`CONDITION`")
	private String condition;
	
	@Column(name="`TEMPERATURE`")
	private double temperature;

	

	//bi-directional one-to-one association to Event
	@OneToOne(cascade={CascadeType.ALL})
	@PrimaryKeyJoinColumn(name="EVENT_ID", referencedColumnName="ID")
	private Event event;

	public Weather() {
	}

	public int getEventId() {
		return this.eventId;
	}

	public void setEventId(int eventId) {
		this.eventId = eventId;
	}

	public String getCondition() {
		return this.condition;
	}

	public void setCondition(String condition) {
		this.condition = condition;
	}

	public Double getTemperature() {
		return this.temperature;
	}

	public void setTemperature(Double temperature) {
		this.temperature = temperature;
	}

	public Event getEvent() {
		return this.event;
	}

	public void setEvent(Event event) {
		this.event = event;
	}

}